from torchvision.models import resnet152

model = resnet152(True)

print("==========nn.modules==========")
for idx, m in enumerate(model.modules()):
    print(idx, '->', m)
    if len(list(m.children())) == 0:
        break
    
print("==========nn.children()==========")
for idx, m in enumerate(model.children()):
    print(idx, '->', m)

print("==========nn._modules==========")
print (model._modules)
for idx in model._modules.keys():
    print(idx, '->', model._modules[idx])

